Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not perform future timestamp checks post-merge #3884

Merged
merged 5 commits into from
Jul 24, 2023

Conversation

Rjected
Copy link
Member

@Rjected Rjected commented Jul 24, 2023

Previously we were performing checks on whether or not the block's timestamp is in the future. Other clients do not perform this check post-merge:
https://github.com/ethereum/go-ethereum/blob/a196f3e8a22b6ad22ced5c2e3baf32bc3ebd4ec9/consensus/beacon/consensus.go#L217-L227

And timestamp checks are supposed to be performed by the CL:

It is absolutely verified on CL

Its just that we are attempting to not duplicate consensus logic across layers. You can easily add sanity checks to time in EL but CL preverifies. Timestamp must be accurate wrt to the outer slot in the beacon block and future slots are not processed (may be queued but would be dropped if more than a few seconds ahead)

So

  • slots are mega respected in CL
  • CL verifies that payload timestamp is a precise function of the slot

From ethereum/go-ethereum#23761 (comment)

Fixes #3879

@Rjected Rjected added C-bug An unexpected or incorrect behavior A-consensus Related to the consensus engine labels Jul 24, 2023
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice find, lgtm, since we ensure this is only performed when paris is active

@mattsse mattsse enabled auto-merge July 24, 2023 15:44
@codecov
Copy link

codecov bot commented Jul 24, 2023

Codecov Report

Merging #3884 (37fd789) into main (b3c8a98) will increase coverage by 0.01%.
The diff coverage is 0.00%.

Impacted file tree graph

Impacted Files Coverage Δ
crates/consensus/beacon/src/beacon_consensus.rs 0.00% <0.00%> (ø)
crates/consensus/common/src/validation.rs 79.45% <ø> (+0.34%) ⬆️
crates/primitives/src/constants.rs 100.00% <ø> (ø)

... and 3 files with indirect coverage changes

Flag Coverage Δ
integration-tests 15.59% <0.00%> (-0.01%) ⬇️
unit-tests 64.25% <0.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
reth binary 26.48% <ø> (ø)
blockchain tree 83.02% <ø> (ø)
pipeline 89.60% <ø> (ø)
storage (db) 74.18% <ø> (ø)
trie 94.45% <ø> (ø)
txpool 46.56% <ø> (+0.56%) ⬆️
networking 77.64% <ø> (+0.01%) ⬆️
rpc 58.19% <ø> (-0.01%) ⬇️
consensus 64.84% <0.00%> (-0.39%) ⬇️
revm 33.66% <ø> (ø)
payload builder 6.61% <ø> (ø)
primitives 87.26% <ø> (ø)

@mattsse mattsse added this pull request to the merge queue Jul 24, 2023
Merged via the queue into main with commit 0ff75b5 Jul 24, 2023
28 checks passed
@mattsse mattsse deleted the dan/check-future-timestamp-pre-ttd branch July 24, 2023 16:48
merklefruit pushed a commit to anton-rs/op-reth that referenced this pull request Jul 27, 2023
)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-consensus Related to the consensus engine C-bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reth loses connection to Consensus layer and is unable to reconnect until Reth is restarted
3 participants